/*
 * @Author: lixiang
 * @Description:
 * @Date: 2021-09-13 11:24:26
 */
import Vue from "vue";
import VueRouter from "vue-router";
// import AskModel from "@/scripts/common/askModel";
// import Route from "@/scripts/common/route";
// import store from "@/store/index";


Vue.use(VueRouter);

const routes = [
  {
    path: "/login",
    name: "login",
    meta: {
      title: "登录"
    },
    component: () => import("@/views/login.vue")
  },
  {
    path: "/index",
    name: "index",
    meta: {
      title: "首页"
    },
    component: () => import("@/views/index.vue"),
    children:[
      {
        meta: {
          title: "首页"
        },
        path: "/stat/home", //账号管理
        component: () => import("@/views/stat/home.vue")
      },
      {
        meta: {
          title: "账号管理"
        },
        path: "/index/system/account", //账号管理
        component: () => import("@/views/system/account-list.vue")
      },
      {
        meta: {
          title: "菜单管理"
        },
        path: "/index/system/menu", //菜单管理
        component: () => import("@/views/system/menu-list.vue")
      },
      {
        meta: {
          title: "宠物分类管理"
        },
        path: "/index/system/petType", //宠物分类管理
        component: () => import("@/views/system/pet-type-list.vue")
      },
      {
        meta: {
          title: "常用语管理"
        },
        path: "/index/system/commonWords", //常用语管理
        component: () => import("@/views/system/common-words-list.vue")
      },
      {
        meta: {
          title: "枚举常用语管理"
        },
        path: "/index/system/complaintTypeList", //常用语管理
        component: () => import("@/views/system/complaintType-list.vue")
      },
      {
        meta: {
          title: "订单反馈常用语管理"
        },
        path: "/index/system/complaintTypeOrderList", //常用语管理
        component: () => import("@/views/system/complaintType-order-list.vue")
      },
      {
        meta: {
          title: "门店建议常用语管理"
        },
        path: "/index/system/complaintTypeAdviseList", //常用语管理
        component: () => import("@/views/system/complaintType-advise-list.vue")
      },
      {
        meta: {
          title: "服务管理"
        },
        path: "/index/system/service", //服务管理
        component: () => import("@/views/system/service-list.vue")
      },
      {
        name: "merchant",
        meta: {
              title: "商户管理"},
        path: "/store/list", //商户管理
        component: () => import("@/views/store/merchant-list.vue")
      },
      {
        name: "merchant",
        meta: {
              title: "商户订单管理"},
        path: "/store/orderList", //商户管理
        component: () => import("@/views/store/merchant-order-list.vue")
      }
      ,
      {
        name: "merchantBill",
        meta: {
              title: "未结账单"},
        path: "/store/billList", //未结账单
        component: () => import("@/views/store/merchant-bill-list.vue")
      }
      ,
      {
        name: "merchantBillFinish",
        meta: {
              title: "已结账单"},
        path: "/store/billFinishList", //已结账单
        component: () => import("@/views/store/merchant-finish-bill-list.vue")
      }
      ,
      {
        name: "user",
        meta: {
              title: "用户管理"},
        path: "/user/list", //用户管理
        component: () => import("@/views/user/user-list.vue")
      }
      ,
      {
        name: "opus",
        meta: {
              title: "作品管理"},
        path: "/opus/list", //用户管理
        component: () => import("@/views/opus/opus-list.vue")
      }
      ,
      {
        name: "petEncyclopedia",
        meta: {
              title: "宠物百科管理"},
        path: "/petEncyclopedia/list", //宠物百科管理
        component: () => import("@/views/petEncyclopedia/pet-encyclopedia-list.vue")
      }
      ,
      {
        name: "complaintTip",
        meta: {
              title: "举报投诉列表管理"},
        path: "/opus/complaint/tip/list", //举报投诉列表管理
        component: () => import("@/views/opus/complaint-tip-list.vue")
      }
      ,
      {
        name: "complaintAdvise",
        meta: {
              title: "门店建议列表"},
        path: "/opus/complaint/advise/list", //门店建议列表
        component: () => import("@/views/opus/complaint-advise-list.vue")
      }
      ,
      {
        name: "complaintOrder",
        meta: {
              title: "订单投诉建议列表"},
        path: "/opus/complaint/order/list", //订单投诉建议列表
        component: () => import("@/views/opus/complaint-order-list.vue")
      }
    ]
  },
  
  
];

const router = new VueRouter({
  mode: "hash",
  base: "/postPay/",
  routes
});

// router.beforeEach((to, from, next) => {
//   to.meta.title = to.params.title
//     ? decodeURIComponent(to.params.title)
//     : to.query.title
//       ? to.query.title
//       : to.meta.title;
//   next();
// });

export default router;
